package
{
	import flash.display.Sprite;
	import flash.geom.Rectangle;
	
	import kov.core.BlockData;
	import kov.core.Body;
	import kov.core.MapData;
	import kov.core.StateCommand;
	import kov.core.body.sb.ShuiBing;
	import kov.core.body.zy.ZYBeiZhan;
	import kov.core.body.zy.ZhaoYun;
	import kov.core.global.Global;
	import kov.geom.Cube;
	
	import net.hires.debug.Stats;
	
	[SWF(backgroundColor="#000000")]
	public class Main extends Sprite
	{
		public function Main()
		{
			Global.init(this);
			
			// 地图
			var blockData:BlockData = new BlockData();
			blockData.addBlock(new Rectangle(0, 0, 884, 120));
			blockData.addBlock(new Rectangle(180, 114, 160, 20));
			blockData.addBlock(new Rectangle(200, 144, 150, 25));
			var mapData:MapData = new MapData(blockData);
			Global.world.mapData = mapData;
			
			// 玩家
			var zy:ZhaoYun = new ZhaoYun();
			zy.locateAt(500, 200, 0);
			Global.world.addPlayer(zy);
			
			// NPC
			var sb:ShuiBing;
			for (var i:int = 0; i < 20; i++)
			{
				sb = new ShuiBing();
				var toX:int = int(Math.random()*Global.GAME_WIDTH);
				var toY:int = int(Math.random()*200)+130;
				sb.locateAt(toX, toY, 0);
				Global.world.addNPC(sb);
			}
			
			addChild(new Stats());
		}
		
	}
}